﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PrinterStatus.aspx.cs" Inherits="WebApplication1.PrinterStatus" MasterPageFile="~/masterpage/User.Master" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <%--Begin Loading ajax section--%>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
                <div class="center">

                    <img alt="" src="images/loading.gif" />
                </div>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <%--End Loading ajax section--%>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        
        <ContentTemplate>
            <div class="container-fluid">

                <fieldset>
                    <legend>Server Printer Status</legend>
                </fieldset>
            </div>
            <div class="control-group col-md-12">

                <asp:ListView ID="ListView1" runat="server" DataSourceID="ObjectDataSource1">
                    <EditItemTemplate>
                        <tr style="background-color: #999999;">
                            <td>
                                <asp:Button ID="UpdateButton" runat="server" class="btn  btn-primary" CommandName="Update" Text="Update" />
                                <asp:Button ID="CancelButton" runat="server" class="btn  btn-primary" CommandName="Cancel" Text="Cancel" />
                            </td>
                            <td>
                                <asp:TextBox ID="idTextBox" runat="server" Text='<%# Bind("id") %>' MaxLength="20" />
                            </td>
                            <td>
                                <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' MaxLength="199" ToolTip="Printer name" />
                            </td>
                            <td>
                                <asp:TextBox ID="statusTextBox" runat="server" Text='<%# Bind("status") %>' MaxLength="199" />
                            </td>
                        </tr>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <table runat="server" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;">
                            <tr>
                                <td>No data was returned.</td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <tr style="">
                            <td>
                                <asp:Button ID="InsertButton" runat="server" class="btn  btn-primary" CommandName="Insert" Text="Insert" />
                                <asp:Button ID="CancelButton" runat="server" class="btn  btn-primary" CommandName="Cancel" Text="Clear" />
                            </td>
                            <td>
                                <asp:TextBox ID="idTextBox" runat="server" Text='<%# Bind("id") %>' MaxLength="10" />
                            </td>
                            <td>
                                <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' MaxLength="199" ToolTip="Printer name" />
                            </td>
                            <td>
                                <asp:TextBox ID="statusTextBox" runat="server" Text='<%# Bind("status") %>' />
                            </td>
                        </tr>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <tr style="">
                            <td>
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                            </td>
                            <td>
                                <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                            </td>
                            <td>
                                <asp:Label ID="statusLabel" runat="server" Text='<%# Eval("status") %>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <table runat="server">
                            <tr runat="server">
                                <td runat="server">
                                    <table id="itemPlaceholderContainer" runat="server" border="0" style="" class="table table-hover table-bordered">
                                        <tr runat="server" class="info">
                                            <th runat="server">Id</th>
                                            <th runat="server">Printer Name</th>
                                            <th runat="server">Printer Status</th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr runat="server">
                                <td runat="server" border="0" style="" >
                                    <asp:DataPager ID="DataPager1" runat="server" PageSize="5">
                                        <Fields>
                                           <%-- <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />--%>
                                            <asp:NumericPagerField />
                                        </Fields>
                                    </asp:DataPager>
                                   

                                </td>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <tr style="background-color: #E2DED6; font-weight: bold; color: #333333;">
                            <td>
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                            </td>
                            <td>
                                <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                            </td>
                            <td>
                                <asp:Label ID="statusLabel" runat="server" Text='<%# Eval("status") %>' />
                            </td>
                        </tr>
                    </SelectedItemTemplate>
                </asp:ListView>

            </div>

            <div class="container-fluid">

                <fieldset>
                    <legend>Server Queued Print Jobs</legend>
                </fieldset>
            </div>

            <div class="control-group col-md-12">

                <asp:ListView ID="ListView2" runat="server" DataSourceID="odsPrintJob">


                    <EmptyDataTemplate>
                        <table runat="server" style="background-color: #FFFFFF; border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;">
                            <tr>
                                <td>No data was returned.</td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>

                    <ItemTemplate>
                        <tr style="">
                            <td>
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                            </td>
                            <td>
                                <asp:Label ID="printernameLabel" runat="server" Text='<%# Eval("printername") %>' />
                            </td>
                            <td>
                                <asp:Label ID="statusLabel" runat="server" Text='<%# Eval("status") %>' />
                            </td>
                        </tr>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <table runat="server">
                            <tr runat="server">
                                <td runat="server">
                                    <table id="itemPlaceholderContainer" runat="server" border="1" style="" class="table table-hover table-bordered">
                                        <tr runat="server" class="info">
                                            <th runat="server">ID</th>
                                            <th runat="server">Printer</th>
                                            <th runat="server">Print Job Status</th>
                                        </tr>
                                        <tr id="itemPlaceholder" runat="server">
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr runat="server">
                                <td runat="server" style="text-align: center; background-color: #5D7B9D; font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF"></td>
                            </tr>
                        </table>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        <tr style="background-color: #E2DED6; font-weight: bold; color: #333333;">
                            <td>
                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
                            </td>
                            <td>
                                <asp:Label ID="printernameLabel" runat="server" Text='<%# Eval("printername") %>' />
                            </td>
                            <td>
                                <asp:Label ID="statusLabel" runat="server" Text='<%# Eval("status") %>' />
                            </td>
                        </tr>
                    </SelectedItemTemplate>
                </asp:ListView>

            </div>

            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllPrinter" TypeName="Business.PrinterManagement"></asp:ObjectDataSource>
            <asp:ObjectDataSource ID="odsPrintJob" runat="server" SelectMethod="GetAllPrintJob" TypeName="Business.PrinterManagement"></asp:ObjectDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

